package com.nursinghome.bean;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Account {
    @ExcelProperty("账单id")
    private Long aid;//账单id

    @ColumnWidth(30)
    @ExcelProperty("账单号")
    @NotBlank(message = "账单号为空")
    private String ano;//账单号
    @ExcelProperty("账单金额")
    @NotNull(message = "账单金额不能为空")
    private BigDecimal amoney;//账单金额
    @ExcelProperty("账单状态")
    private Integer astate;//账单状态 1未支付、2支付、3坏账
    @ExcelProperty("账单日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GTM+8")
    @DateTimeFormat("yyyy-MM-dd")
    @ColumnWidth(20)
    @NotNull(message = "账单日期不能为空")
    private Date adata;
    @ExcelIgnore
    private String description;//账单表述
    @ExcelProperty("账单对应老人")
    @NotNull(message = "老人不能为空")
    private Long eid;//一对一的老人id
    @ExcelIgnore
    private Elderly elderly;//账单所属老人一对一
    @ExcelIgnore
    private Room room;
}
